<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>数据详情</title>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
    <%@include file="../include/commonFile.jsp" %>
</head>
<body>
<!--头部-->
<%@include file="../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">
            <div class="layui-tab-item layui-show">
                <div class="layui-tab layui-tab-brief" lay-filter="type">
                    <ul class="layui-tab-title" id="zc_tab">
                        <li <c:if test="${isCopartner == 0}">class="layui-this"</c:if>>众筹分销</li>
                        <li <c:if test="${isCopartner == 1}">class="layui-this"</c:if>>课程分销</li>
                    </ul>
                    <div class="layui-tab-content">
                        <form class="layui-form" action="${ctx}/copartner/analyze/crowdfundDistributeList.do?parentId=${memberId}" id="myForm" method="post">
                            <input type="hidden" name="pageNo" id="pageNo"/>
                            <div class="f-search-bar">
                                <div class="search-container">
                                    <ul class="search-form-content">
                                        <li class="form-item-inline"><label class="search-form-lable">项目名称</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="title" autocomplete="off"
                                                       class="layui-input" value="${title}" placeholder="项目名称">
                                            </div>
                                        </li>

                                        <li class="form-item">
                                            <label class="search-form-lable">排&emsp;&emsp;序</label>
                                            <div class="layui-input-inline" style="width: 165px">
                                                <select name="orderBy">
                                                    <option value="1" ${empty input.orderBy or input.orderBy == 1 ? 'selected' : ''}>报名人数最多</option>
                                                    <option value="2" ${input.orderBy == 2 ? 'selected' : ''}>参与时间最近</option>
                                                </select>
                                            </div>
                                        </li>

                                        <li class="form-item-inline">
                                            <div class="sub-btns">
                                                <a class="layui-btn layui-btn-danger" href="javascript:submitFunction('#myForm')">查询</a>
                                                <a class="layui-btn layui-btn-normal" href="javascript:resetFunction('#myForm')">重置</a>
                                            </div>
                                        </li>
                                    </ul>
                                    <ul class="search-form-content">
                                        <li class="form-item"><label class="search-form-lable">时&emsp;&emsp;间</label>
                                            <div class="check-btn-inner" id="timeType">
                                                <a id="all" href="javascript:void(0);" onclick="setTimeType($(this),0,'#myForm')" ${empty input.timeType || input.timeType == 0 ? 'class="active"' : ''}>全部</a>
                                                <a href="javascript:void(0);" onclick="setTimeType($(this),1,'#myForm')" ${input.timeType == 1 ? 'class="active"' : ''}>今天</a>
                                                <a href="javascript:void(0);" onclick="setTimeType($(this),2,'#myForm')" ${input.timeType == 2 ? 'class="active"' : ''}>本周内</a>
                                                <a href="javascript:void(0);" onclick="setTimeType($(this),3,'#myForm')" ${input.timeType == 3 ? 'class="active"' : ''}>本月内</a>
                                                <input type="hidden" name="timeType" value="${input.timeType}"/>
                                            </div>
                                            <div class="layui-inline">
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" type="text" name="createStart" value="${input.createStart}" placeholder="开始日">
                                                </div>
                                                -
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" type="text" name="createEnd" value="${input.createEnd}" placeholder="截止日">
                                                </div>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </form>
                        <div class="list-content">
                            <div class="cl">
                                <table class="layui-table">
                                    <colgroup>
                                        <col width="400">
                                        <col width="150">
                                        <col width="100">
                                        <col width="100">
                                        <col width="100">
                                        <col width="120">
                                        <col width="120">
                                        <col width="100">
                                    </colgroup>
                                    <thead>
                                    <tr>
                                        <th>项目名称</th>
                                        <th>参与时间</th>
                                        <th>报名</th>
                                        <th>订单</th>
                                        <th>众筹成功</th>
                                        <th>累计推广资金</th>
                                        <th>直接佣金收入</th>
                                        <th>操 作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach var="analyze" items="${list}">
                                        <tr>
                                            <td>${analyze.title}</td>
                                            <td><fmt:formatDate value="${analyze.createDate}" pattern="yyyy-MM-dd HH:mm"/></td>
                                            <td>${analyze.applyNum}</td>
                                            <td>${analyze.favorerNum}</td>
                                            <td>${analyze.successNum}</td>
                                            <td>${analyze.favorerAmount}</td>
                                            <td>${empty analyze.brokerage?0.00:analyze.brokerage}</td>
                                            <td>
                                                <a title="点击查看项目分佣详情" href="${ctx}/crowdfund/project/copartnerCrowList.do?targetId=${analyze.targetId}&relationId=${analyze.id}">佣金详情</a>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div id="page_content" class="page-container"></div>
                    </div>
                </div>
            </div>
        <!--底部-->
        </div>
        <%@include file="../include/footer.jsp" %>
    </section>
</div>

<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript">
    $(function () {
        //加载分页
        loadPageNew({
            elem: 'page_content',
            totalCount: '${page.totalCount}',
            limit: '${page.limit}',
            page: '${page.page}'
        });
    })
</script>
<script type="text/javascript">


    layui.use(['laypage', 'laydate', 'element'], function () {
        var laypage = layui.laypage, laydate = layui.laydate, element = layui.element;
        // 查询开始日期
        var createStart = {
            elem: 'input[name=createStart]'
        };

        var createEnd = {
            elem: 'input[name=createEnd]'
        };
        laydate.render(createStart);
        laydate.render(createEnd);

        element.on('tab(type)', function (data) {
            if (data.index == 0) {
                location.href = "${ctx}/copartner/analyze/crowdfundDistributeList.do?parentId=${memberId}";
            } else if (data.index == 1) {
                location.href = "${ctx}/copartner/analyze/courseDistributeList.do?parentId=${memberId}";
            }
        });
    });
    txz.initHeader({
        nav:[{
            name: '合伙人数据分析',
            href: '${ctx}/copartner/analyze/list.do'
        },{
            name: '${member.realname}'
        },{
            name: '数据详情',
            curr: true
        }],
        info:'<span class="f12">共 <b id="totalCount">${page.totalCount}</b> 条记录</span>',
        btns: [{
            name: '返回',
            icon: 'back',
            href: '${ctx}/copartner/analyze/list.do'
        }]
    });
</script>
</body>
</html>